
#include "udp/udp_server.hpp"

using namespace std;
int main(int argc, char *argv[])
{
    ADEALL_UDP_SERVER udp;

    if (4 != argc)
    {
        cout << "usage: " << argv[0] << " <hostname/ipaddress> <service/port> <message_to_send>" << endl;
        return -1;
    }

    string msg = argv[3];
    string ip = argv[1];

    int fd = udp.CreateIpFd();

    udp.MessagSend(ip.c_str(), std::stoi(argv[2]), msg, fd);

    close_fd(fd);
    // udp.~ADEALL_UDP_SERVER();
    printf("over..\n");
    return 0;
}